﻿#region Using directives

using System;
using System.ComponentModel;

#endregion

namespace Pharmacy.Entities
{	
	///<summary>
	/// An object representation of the 'StockWarning' view. [No description found in the database]	
	///</summary>
	/// <remarks>
	/// This file is generated once and will never be overwritten.
	/// </remarks>	
	[Serializable]
	[CLSCompliant(true)]
	public partial class StockWarning : StockWarningBase
	{
        [Description(""), System.ComponentModel.Bindable(System.ComponentModel.BindableSupport.Yes)]
        public int StockWarningLevel
        {
            get
            {
                if (InStock < MinStock) return 2;
                if (InStock > MaxStock) return 0;
                return 1;
            }
        }
        [Description(""), System.ComponentModel.Bindable(System.ComponentModel.BindableSupport.Yes)]
        public int ExpiredDateWarningLevel
        {
            get
            {
                if (NearestExp > 180) return 0;
                if (NearestExp > 90) return 1;
                if (NearestExp > 30) return 2;
                return 3;
            }
        }

        #region Constructors

        ///<summary>
        /// Creates a new <see cref="StockWarning"/> instance.
        ///</summary>
        public StockWarning() : base() { }

        #endregion
	}
}
